<%@ page language="java" contentType="text/html; charset=utf-8"%>
<%@ taglib prefix="s" uri="/struts-tags" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>应用管理</title>
<link href="styles/general.css" rel="stylesheet" type="text/css" /><link href="styles/main.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript" src="js/common.js"></script>
    <script src="js/utils.js" type="text/javascript"></script>
    <script type="text/javascript" src="js/jquery/uploadify/jquery.min.js"></script>
    <script type="text/javascript" src="js/jquerytablesorter/jquery.tablesorter.min.js"></script>
	
<link rel="stylesheet" type="text/css" href="http://ajax.pupkk.com/dojo/1.7.5/dojo/resources/dojo.css" />
	<link rel="stylesheet" type="text/css" href="http://ajax.pupkk.com/dojo/1.7.5/dijit/themes/tundra/tundra.css" />
	<script src="http://ajax.pupkk.com/dojo/1.7.5/dojo/dojo.js" djConfig="parseOnLoad:true"></script>
    <script type="text/javascript">
		dojo.require("dojo.parser");
		dojo.require("dijit.form.DateTextBox");
		dojo.require("dijit.form.FilteringSelect");
		var appdel=function(type,appnumber){
			var url = "app_save.do?type="+type+"&model.appnumber="+appnumber;
			window.location.href=url;
		};
		function appshow(type,appnumber,msg)
		{
			var cpid = dijit.byId("cpid").get('value');
			var categoryparentid = document.getElementById("categoryparentid").value;
			var appName = document.getElementById("appName").value;
			var url="app_show.do?type="+type+"&model.appnumber="+appnumber+"&cpid="+cpid+"&categoryparentid="+categoryparentid+"&appName="+appName;
			if(msg){
				url+="&msg="+msg;
			}
			window.location.href=url;
		}
		function appshow1(appnumber)
		{
			var url="app_show1.do?type=app&model.appnumber="+appnumber;
			window.location.href=url;
		}
		function offonline(appnumber,appstatus)
		{
			$.get("app_saveoffonline.do?type=offonline&model.appnumber="+appnumber+"&model.appstatus="+appstatus, 
           function(data) 
           { 
              document.getElementById("appstatusdiv_"+appnumber).innerHTML=data;
           });
		}
		function appversionlist(appnumber)
		{
			var cpid = dijit.byId("cpid").get('value');
			var categoryparentid = document.getElementById("categoryparentid").value;
			var appName = document.getElementById("appName").value;
			window.location.href="appversion_list.do?app.appnumber="+appnumber+"&cpid="+cpid+"&categoryparentid="+categoryparentid+"&appName="+appName;
		}
		function appointofbillinglist(appnumber)
		{
			var cpid = dijit.byId("cpid").get('value');
			var categoryparentid = document.getElementById("categoryparentid").value;
			var appName = document.getElementById("appName").value;
			window.location.href="apppointofbilling_list.do?appinfo.appnumber="+appnumber+"&cpid="+cpid+"&categoryparentid="+categoryparentid+"&appName="+appName;
		}
	</script>
</head>

<body>
	<h1>
        <span class="action-span"><a href="javascript:void(0);" onclick="appshow('insert','')">添加游戏</a></span> 
        <span class="action-span1"><a href="mainframe.jsp">首页</a></span>
        <span id="search_id" class="action-span1">- 游戏信息管理 </span>
    </h1><br />
     <!--搜索 -->
     <div style="display:none;">
    <form name="form1" method="post" action="app_list.do" id="form1">
    <div class="form-div">
        <div id="Panel1">
	
            <img height="22" width="26" border="0" alt="SEARCH" src="img/icon_search.gif">
            CP：
            <select id="cpid" name="cpid" dojoType="dijit.form.FilteringSelect">
            	<option value="-1">--选择CP--</option>
            	<s:iterator value="cplist">
            		<option <s:if test="id.equals(cpid)">selected</s:if> value="<s:property value="id" />"><s:property value="cpName" /></option>
            	</s:iterator>
            </select>
            类别：
            <select id="categoryparentid" name="categoryparentid">
            	<option value="-1">--选择类别--</option>
            	<s:iterator value="caplist">
            		<s:if test="parentId==0">
            			<option <s:if test="id.equals(categoryparentid)">selected</s:if> value="<s:property value="id" />"><s:property value="categoryName" /></option>
            		</s:if>
            	</s:iterator>
            </select>
            应用名称：<input name="appName" type="text" id="appName"  value="<s:property value="appName"/>"/>
            <input type="submit" name="ButtonSearch" value=" 搜索 " id="ButtonSearch" class="button" />
        
</div>
    </div>
    </form></div>
   <!-- start ad menu list -->
    <div class="list-div" id="listDiv">
        <table id="myTable" width="100%" cellspacing="1" cellpadding="2" class="sortable">
            <thead>
                <tr>
                    <th height="25">序号</th>
				    <th>游戏名称</th>
				    <th>类别</th>
				    <th>包名</th>
				    <th>版本</th>
				    <!--<th>计费点信息</th>
				     <th>状态</th> -->
				     <th></th>
				    <th></th>
                </tr>
             </thead>
             <s:if test="list.size()>0">
             <tbody>
			 <s:iterator value="list" status="i"> 
				 <tr style="height:30px">
                    <td style="background-color: rgb(255, 255, 255);"><s:property value="#i.count"/></td>
                    <td style="background-color: rgb(255, 255, 255);" nowrap="nowrap"><s:property value="appname"/></td>
				    <td style="background-color: rgb(255, 255, 255);"><s:iterator value="caplist"><s:if test="id.equals(categoryid)"><s:property value="categoryName" /></s:if></s:iterator></td>
				    <td style="background-color: rgb(255, 255, 255);"><s:property value="apppackage"/></td>
				    <td style="background-color: rgb(255, 255, 255);"><s:property value="appversion"/></td>
				    <!--<td style="background-color: rgb(255, 255, 255);"><s:set name="tmp_map" value="pointsmap[appnumber]" /><s:iterator var="point" status="s" value="#tmp_map"><span><s:property value="#point.pointofbillingname" />(<s:property value="fee" />)</span><s:if test="#s.index!=0&&#s.index%5==0"><br /></s:if><s:else><s:if test="#s.index<(#tmp_map.size()-1)">&nbsp;|&nbsp;</s:if></s:else></s:iterator></td>
				     <td style="background-color: rgb(255, 255, 255);">
				    <div id="appstatusdiv_<s:property value="appnumber"/>">
				    <s:if test="appstatus==0"><a href="javascript:void(0);" onclick="offonline('<s:property value="appnumber"/>','<s:property value="appstatus"/>')">正常</a>
				    </s:if><s:else><a href="javascript:void(0);" onclick="offonline('<s:property value="appnumber"/>','<s:property value="appstatus"/>')">暂停</a></s:else>
				    </div>
				    </td> -->
				    <td align="left" nowrap="nowrap" style="background-color: rgb(255, 255, 255);">
				    	<a href="javascript:void(0);" onclick="appointofbillinglist('<s:property value="appnumber"/>')">计费点</a>&nbsp;
						<a href="javascript:void(0);" onclick="appshow1('<s:property value="appnumber"/>')">物料</a>
				    </td>
				    <td align="left" nowrap="nowrap" style="background-color: rgb(255, 255, 255);">
				     <s:if test="isUpdate.equals('true')">
				     	<a href="javascript:void(0);" onclick="appshow('update','<s:property value="appnumber"/>')">
				     	<img height="16" width="16" border="0" src="img/icon_edit.gif" alt="编辑"></a>&nbsp;
				     	<a href="javascript:void(0);" onclick="if(confirm('警告！！确定要删除吗？')){appdel('del','<s:property value="appnumber"/>')}" >
							<img height="16" width="16" border="0" src="img/icon_trash.gif" alt="删除">
						</a>
					</s:if>
					<s:else>
						<a href="javascript:void(0);" onclick="appshow('update','<s:property value="appnumber"/>')">
							<img height="16" width="16" border="0" src="img/icon_view.gif" alt="查看">
						</a>   
					</s:else><!-- &nbsp;
			     	<s:if test="appfilename!='null'&&appfilename.length()>0">
		                <a href="<%=request.getContextPath() %>/app_downApp.do?model.appnumber=<s:property value="appnumber"/>">
		                  <img height="16" width="16" border="0" src="img/icon_download.png" alt="下载">
		                </a>
		            </s:if> -->
					</td>
				</tr>
			</s:iterator>
			 </tbody>
			</s:if>
  </table>
  </div>
 <!--Bottom开始-->
    <script language="JavaScript">

if (document.getElementById("listDiv"))
{
  document.getElementById("listDiv").onmouseover = function(e)
  {
    obj = Utils.srcElement(e);

    if (obj)
    {
      if (obj.parentNode.tagName.toLowerCase() == "tr") row = obj.parentNode;
      else if (obj.parentNode.parentNode.tagName.toLowerCase() == "tr") row = obj.parentNode.parentNode;
      else return;

      for (i = 0; i < row.cells.length; i++)
      {
        if (row.cells[i].tagName != "TH") row.cells[i].style.backgroundColor = '#eeeded';
      }
    }

  }

  document.getElementById("listDiv").onmouseout = function(e)
  {
    obj = Utils.srcElement(e);

    if (obj)
    {
      if (obj.parentNode.tagName.toLowerCase() == "tr") row = obj.parentNode;
      else if (obj.parentNode.parentNode.tagName.toLowerCase() == "tr") row = obj.parentNode.parentNode;
      else return;

      for (i = 0; i < row.cells.length; i++)
      {
          if (row.cells[i].tagName != "TH") row.cells[i].style.backgroundColor = '#FFF';
      }
    }
  }

}
$(document).ready(function() {
	   $("#myTable").tablesorter();
	   
	});
    </script>
    
<div id="footer">
<br />
<s:property value="bottom"/></div>
    <!--Bottom结束-->
</body>
</html>